import redis.clients.jedis.Jedis;

import java.util.HashMap;
import java.util.Map;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2017/11/11 23:54
 */
public class JavaContactRedis {
    /**
     * Author song  醉美柳舞之众星捧月
     * Date & Time  2017/11/11 23:55
     * Description     Java Contact Redis
     */
    public static void main(String[] args) {
        Jedis jedis = new Jedis("127.0.0.1", 6379, 3000);
//        jedis.set("java", "coder520");
//        jedis.set("c++", "coder520+1");
//        jedis.set("python", "coder520++1");
//        System.out.println(jedis.mget("java", "c++", "python"));
        Map<String, String> map = new HashMap<>();
        map.put("java", "coder520+1");
        map.put("c++", "coder520+2");
        map.put("python", "coder520+3");
        jedis.hmset("coder", map);
        System.out.println(jedis.hget("coder", "c++"));
        System.out.println(jedis.hgetAll("coder"));
    }
}
